﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DiagrammInternalStructure
{
    public class FunctionParameter : FieldElement, IComparable
    {


        public int CompareTo(object obj)
        {
            FunctionParameter par = (obj as FunctionParameter);
            if (par.Name == Name &&
                par.Type == Type &&
                par.Multiple == Multiple
                )
            {
                return 1;
            }
            return 0;
        }

        public bool Ref
        {
            get
            {
                return m_modification.Contains(FieldModification.RefferenceParameter);
            }
            set
            {
                if (!Ref && value)
                {
                    m_modification.Add(FieldModification.RefferenceParameter);
                }
                else if (Ref && !value)
                {
                    m_modification.Remove(FieldModification.RefferenceParameter);
                }
            }
        }
    }
}
